var obj = new URLSearchParams(location.search);
var key = obj.get('key')
// console.log(categoryId);
$.ajax({
    type: 'get',
    url: `/posts/search/${key}`,
    success: function (res) {
        console.log(res);
        var html = template('listTpl', { data: res })
        $('#listBox').html(html)
    }
})